package easy;

public class Solution_1108 {

    /*public String defangIPaddr(String address) {
        return address.replace(".", "[.]");
    }*/

    public String defangIPaddr(String address) {
        StringBuffer buffer = new StringBuffer();
        for (int i = 0; i < address.length(); i++) {
            if (address.charAt(i) != '.') {
                buffer.append(address.charAt(i));
            } else {
                buffer.append("[.]");
            }
        }
        return buffer.toString();
    }

    public static void main(String[] args) {
        Solution_1108 model = new Solution_1108();
        System.out.println(model.defangIPaddr("1.1.1.1"));
    }
}
